feat: add SSR error handling playground example#1150
feat: add SSR error handling playground example#1150travisbreaks wants to merge 1 commit intovitejs:mainfrom
Conversation
Add a new playground demonstrating React 19 SSR error handling patterns: - onError callback on renderToReadableStream for server-side error logging - digest property for opaque error identification across server/client - captureOwnerStack for owner-chain debugging in development - SSR-to-CSR fallback when the server shell fails to render - onRecoverableError on hydrateRoot for hydration mismatch logging - ErrorBoundary component catching both SSR and client-only errors Includes two error scenario pages (ThrowsRender, ThrowsEffect), integration tests, and a README documenting each pattern. Closes vitejs#795 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Friendly ping. Happy to address any feedback or adjust the approach if needed. |
|
The referenced issue is for rsc example #795. |
|
Thanks for the review. You're right, the current example covers SSR patterns (renderToReadableStream, onError, digest) but #795 is asking for RSC: broken streams on the client, server function errors, the waku-style integration. I'll revise with RSC focus. Should I extend this PR or start fresh? |
It's your call. Thanks |
|
@hi-ogawa Thanks for the direction. I think a fresh PR focused specifically on RSC error handling (broken streams, server function errors, Waku-style patterns per #795) would be cleaner than trying to bolt RSC onto this SSR example. I'll close this one and open a new PR with RSC focus. If the SSR error handling example has standalone value, happy to reopen this separately, but RSC is the priority per the issue. |
Summary
Closes #795.
Adds a comprehensive SSR error handling playground demonstrating React 19 error handling patterns with vite-plugin-react's RSC/SSR support.
Patterns covered:
onErrorcallback onrenderToReadableStreamfor server-side error loggingdigestproperty forwarding from server errors to client error boundariesReact.captureOwnerStack()for owner-chain debugging in developmentonRecoverableErrorfor hydration mismatch detectionWhat's included:
playground/ssr-react-error-handling/with entry-server, entry-client, ErrorBoundary, and page components for each error scenarioTest plan
pnpm devin playground, visit each error pageonErrorfires with digest